package Thread;
//2.创建子类实现Runnable接口，重写run
/**
 * @projectName: Thread-20250806
 * @package: Thread
 * @className: Demo2
 * @author: Tongxinxin
 * @description: TODO
 * @date: 2025/8/6 10:51
 * @version: 1.0
 */
class MyRunnable implements Runnable{
    @Override
    public void run() {
        System.out.println("thread!");
    }
}
public class Demo2 {
    public static void main(String[] args) {
        Runnable runnable=new MyRunnable();
        Thread t=new Thread(runnable);
        t.start();
    }

}
